<%@page import="com.ilibrary.constants.MyConstants"%>
<%@page import="com.ilibrary.web.vo.UserInfoVO"%>
<%@page import="com.ilibrary.web.vo.BookVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="../_common.jsp" %>
<title>藏书详情</title>
<link href="<%=request.getContextPath()%>/template_css/index/index.css" rel="stylesheet" type="text/css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/template_css/search/base.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/template_css/search/main.css">
</head>

<%
	BookVO bookVO = (BookVO)request.getAttribute("bookVO");
%>

<body>
	<%@include file="header.jsp" %>
	<div id="content" style="height: auto;overflow: hidden;">
		<div style="width: 100%;height: 25px;line-height: 30px;background-color: #FFFFCC;text-align: left;font-size: 14px;font-weight: bold;color: #A85300;">书目信息</div>
		<div style="width: 100%;height: 180px;">
			<table>
				<tr>
					<td style="font-weight: bold;" align="right" width="100">书&nbsp;&nbsp;&nbsp;&nbsp;名:</td>
					<td width="300"><%=bookVO.getBookName() %></td>
					<td>书籍ID：<%=bookVO.getBookId() %></td>
				</tr>
				<tr>
					<td style="font-weight: bold;" align="right" width="100">作&nbsp;&nbsp;&nbsp;&nbsp;者:</td>
					<td><%=bookVO.getBookAuthor() %></td>
					<td>状态：<%=bookVO.getBookStatusString() %></td>
				</tr>
				<tr>
					<td style="font-weight: bold;" align="right" width="100">类&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
					<td><%=bookVO.getCategoryName() %></td>
					<td><a style="cursor: pointer;color: blue;" href="javascript: void(0)" onclick="ajaxCollectBook(<%=bookVO.getBookId() %>)">收藏该书</a></td>
				</tr>
				<tr>
					<td style="font-weight: bold;" align="right" width="100">定&nbsp;&nbsp;&nbsp;&nbsp;价:</td>
					<td><%=bookVO.getBookPrice() %>￥</td>
				</tr>
				<tr>
					<td style="font-weight: bold;" align="right" width="100">出版社:</td>
					<td><%=bookVO.getBookPubHouse() %></td>
				</tr>
				<tr>
					<td style="font-weight: bold;" align="right" width="100">出版日期:</td>
					<td><%=bookVO.getBookPubDt() %></td>
				</tr>
			</table>
		</div>
		
		<div style="width: 100%;height: 25px;line-height: 30px;background-color: #FFFFCC;text-align: left;font-size: 14px;font-weight: bold;color: #A85300;">内容简介</div>
		<div style="width: 100%;height: 300px;line-height: 300px;text-align: center;">
			测试简介
		</div>
		
		<div style="width: 100%;height: 30px;clear: both;"></div>
	</div>
	<%@include file="footer.jsp" %>
</body>

<script type="text/javascript">
	function check_user() {
		var userId = $('#userId').val();
		var userPassword = $('#userPassword').val();
		if(userId == null || userId == '') {
			alert("请输入有效登录学号！");
			$('userId').focus();
			return false;
		}
		if(userPassword == null || userPassword == '') {
			alert("请输入有效登录密码！");
			$('userPassword').focus();
			return false;
		}
		$('#clientLoginForm').submit();
	}
	function ajaxCollectBook(bookId) {
		if(<%=session.getAttribute(MyConstants.ILIBRARY_lOGIN_USER) == null%>) {
			alert("请先登录后再试!");
			return;
		}else {
			$.ajax({
				url: '<%=request.getContextPath() %>/collect/add.action',
				data: {
					'bookId':bookId
				},
				type: 'post',
				dataType: 'json',
				async: 'false',
				success: function(msg) {
					if(msg.error != null) {
						alert(msg.error);
					}else {
						alert("收藏成功！");
						//location.href = "";
					}
				}
			});
		}
	}
</script>

</html>
